package GA;

import studentsGA.StudentGene;
import studentsGA.StudentsAlgorithm;


public class Phenotype {	
	
	public static double[] getValue(Gene[] gene, int chromosomeLenght){
		if (gene instanceof StudentGene[]){
			StudentGene student;
			double[] phenotype = new double[gene.length];
			for (int i = 0; i < gene.length; i++){
				student = (StudentGene) gene[i];
				if (student.id >= 0)
					phenotype[i] = StudentsAlgorithm.students[student.id].getId();
				else 
					phenotype[i] = -1;
			}
			return phenotype;
		}
		return null;
	}
}
